package cn.tedu.vacate.controller;

import cn.tedu.base.response.JsonResult;
import cn.tedu.vacate.pojo.dto.VacateSaveParam;
import cn.tedu.vacate.service.VacateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/v1/vacate")
public class VacateController {
    @Autowired
    private VacateService vacateService;
    /**
     * 员工请假
     * @return
     */
    @PostMapping("staffLeave")
    public JsonResult staffLeave(VacateSaveParam vacateSaveParam){
        log.debug("传入的请假参数{}",vacateSaveParam);
        vacateService.saveLeave(vacateSaveParam);
        return JsonResult.ok();
    }
}
